<script type="text/javascript">
$.extend($.fn.validatebox.defaults.rules,{
   checkDeviceCode:{
    validator:function(value,param){
		printLog(value);
		var parkAreaCode = $('#parkAreaCode').val();
		var parkDeviceCode = $('#parkDeviceCode').val();
		var rs = true;
		if(parkAreaCode&&parkDeviceCode) {
			jmaxSyncAjax('parkingDevice.do?checkDeviceInAreaIsExit',{areaCode:parkAreaCode,deviceCode:parkDeviceCode},function(data) {
				printLog('rs1='+rs);
				rs = data;
			});
		}
		printLog('rs2='+rs);
		return rs;
    },
    message:'该区域设备代码已存在.'
   }
  });
</script>
<table cellpadding="5">
	<tr>
		<td class="tbLabel">区域代码:</td>
		<td>
			<input id="parkAreaCode" name="areaCode"  class="easyui-validatebox textbox" data-options="required: true" value="" validType="checkDeviceCode[]"/>
		</td>
	</tr>
	<tr>
		<td>网关代码:</td>
		<td>
			<input name="gwid"  class="easyui-validatebox textbox" data-options="required: true" value=""/>
		</td>
	</tr>
	<tr>
		<td>设备代码:</td>
		<td>
			<input id="parkDeviceCode" name="deviceCode"  class="easyui-validatebox textbox" data-options="required: true" value="" validType="checkDeviceCode[]"/>
		</td>
	</tr>
	<tr>
		<td>计费方式:</td>
		<td>
			<@eu.comboBox url="common.do?loadComboBox&key=DEVICE_BILLING&value=1" name="billing" required="true"/>
		</td>
	</tr>
	<tr>
		<td>单位费用(分):</td>
		<td>
			<input name="cost" style="width:158px;" class="easyui-numberbox" value="5"  precision="0" data-options="required: true" />
		</td>
	</tr>
</table>
